/*
 * @Description: 虫情预警
 */
// import zhreq from "@/utils/request-twoline";
import zhreq from "@/utils/request";
// import zhreq from "@/api/pest-online";
export default {
  /**
   * @description: 获取虫情设备
   */
  getinsectDevice() {
    let searchparms = {
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo") || '暂无'
    }
    if (sessionStorage.getItem("parentId")) {
      searchparms.organizationNo = sessionStorage.getItem("parentId")
      searchparms.less = "gl"
    }
    return zhreq.post("v3/insectSituation/insectDevice/queryByCondition", searchparms);
  },
  /**
   * @description: 获取某个时间段各害虫数量
   * endTime
   * insectDeviceId
   * startTime
   */
  queryPestsNumber(params) {
    return zhreq.post("v3/insectSituation/insectCollectionResult/queryPestsNumber", {
      ...params
    })
  },
  /**
   * @description: 获取饼图
   */
  getpieChart(params) {
    return zhreq.post("v3/insectSituation/insectCollectionResult/pieChart", {
      ...params
    });
  },
  /**
   * @description: 获取折线图
   */
  getlineChart(params) {
    return zhreq.post("v3/insectSituation/insectCollectionResult/lineChart", {
      ...params
    });
  },
  /**
   * @description: 通过时间段和虫报站id查图片
   */
  getpestimage(params) {
    return zhreq.post("v3/insectSituation/insectCollection/queryPageList", {
      ...params
    });
  },
  /**
   * @description: 设备清洁记录
   */
  getCleanRecord(params) {
    return zhreq.get(`v3/insectSituation/InsectDeviceCleanRecord/queryDeviceDetails?page=${params.page}&size=${params.size}&condition=%255B%257B%2522paramName%2522%3A%2522insectDeviceId%2522%2C%2522value%2522%3A${params.value}%2C%2522startTime%2522%3A%2522${params.startTime}%2522%2C%2522endTime%2522%3A%2522${params.endTime}%2522%2C%2522sign%2522%3A%2522equals%2522%257D%255D`);
  }
  // /**

  // * @description: 设备清洁记录
  // */
  // PostCleanRecord(params) {
  //   return zhreq.post(`v3/insectSituation/InsectDeviceRecord/queryDeviceDetails`,
  //     params);
  // }
}
